<template>
	<view @tap="$emit('click',index)" @longpress="longPress" class="position-relative rounded flex-a-j" style="max-width: 500rpx;">
		
		<free-image @load="loadPoster" :maxWidth="200" :maxHeight="280" imageClass="rounded"  :src="videoPoster"></free-image>
		<text class="iconfont text-white position-absolute" style="font-size: 40px;" :style="`left:${(poster.w/2)-20}px;top:${(poster.h/2)-20}px;`">&#xe737;</text>
		
	</view>
</template>

<script>
	import freeImage from "./free-image.vue"
	export default {
		components:{
			freeImage
		},
		props:{
			videoPoster:{
				default:"",
				type:String
			},
			index:{
				default:0,
				type:Number
			}
		},
		data(){
			return {
				//默认封面的宽高
				poster:{
					w:100,
					h:100
				}
			}
		},
		methods:{
			loadPoster(e){
				
				 this.poster = e
			},
		}
	}
	
	
</script>

<style>
</style>
